From: Carlos Garnacho Date: Sun, 29 Jun 2025 09:35:24 +0000 (+0200) Subject: screenShield: Fix pointer showing on motion X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~116^2^2~72 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7b804eda9c2a62de9dcaf02b64186bac42877656;p=gnome-shell.git screenShield: Fix pointer showing on motion As an additional side effect of switching to the cursor visibility inhibition API in the cursor tracker, there is no longer this infighting in Mutter where pointer motion tries to set pointer visibility on (since it's the last device used), and other places wanting to inhibit it, such as the screenshield. This resulted on the cursor wanting to show by itself, and somehow trigger captured motion events on the ClutterStage. This no longer happens, which results in the pointer staying hidden, seat unfocus remaining uninhibited, and no motion events being sent in (since the pointer device now does remain unfocused). Fix this by: - Setting a seat unfocus inhibition, so the pointer triggers motion and focus despite being hidden - Connecting to captured events on the screen lock group widget, since captured events will respect the existing grab This results in pointer motion again resulting on the cursor being shown, when waking up the lockscreen. Fixes: 91c6366e0 ("Adjust to cursor tracker visibility API changes") Part-of: --- diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 0ee1ce284..2087c393e 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -370,25 +370,30 @@ export class ScreenShield extends Signals.EventEmitter { _showPointer() { if (this._cursorVisibleInhibited) { + const seat = global.stage.context.get_backend().get_default_seat(); this._cursorTracker.uninhibit_cursor_visibility(); + seat.uninhibit_unfocus(); this._cursorVisibleInhibited = false; } if (this._motionId) { - global.stage.disconnect(this._motionId); + this._lockDialogGroup.disconnect(this._motionId); this._motionId = 0; } } _hidePointer() { if (!this._cursorVisibleInhibited) { + const seat = global.stage.context.get_backend().get_default_seat(); + seat.inhibit_unfocus(); this._cursorTracker.inhibit_cursor_visibility(); this._cursorVisibleInhibited = true; } } _hidePointerUntilMotion() { - this._motionId = global.stage.connect('captured-event', (stage, event) => { + const eventActor = this._lockDialogGroup; + this._motionId = eventActor.connect('captured-event', (_, event) => { if (event.type() === Clutter.EventType.MOTION) this._showPointer();